/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package main;

import com.primavera.integration.client.bo.object.Project;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;

/**
 *
 * @author a_lyulyasov
 */
public class busyFrame extends javax.swing.JDialog {

  
  /**
   * Creates new form busyFrame
   */
  public busyFrame(java.awt.Frame parent, boolean modal, MainApp ma, Project project) {
    super(parent, modal);
    initComponents();
    centerOnScreen(this);
    this.setVisible(false);
    this.dispose();

  }
  
  public void projectLoaded () 
  {
    this.setVisible(false);
    this.dispose();
    
  }

 private void centerOnScreen(Container win)
 {
   GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
   Rectangle bounds = gd.getDefaultConfiguration().getBounds();
   Dimension winDim = win.getSize();
   Point loc = new Point((bounds.width - winDim.width) / 2, (bounds.height - winDim.height) / 2);
   win.setLocation(loc);
  }

  /**
   * This method is called from within the constructor to initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is always
   * regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jXBusyLabel1 = new org.jdesktop.swingx.JXBusyLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    setAlwaysOnTop(true);
    setUndecorated(true);
    setResizable(false);
    setType(java.awt.Window.Type.UTILITY);

    jXBusyLabel1.setText("jXBusyLabel1");
    jXBusyLabel1.setBusy(true);
    jXBusyLabel1.setDirection(org.jdesktop.swingx.painter.BusyPainter.Direction.RIGHT);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap(126, Short.MAX_VALUE)
        .addComponent(jXBusyLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addGap(120, 120, 120))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addGap(55, 55, 55)
        .addComponent(jXBusyLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(58, Short.MAX_VALUE))
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

 

  /**
   * @param args the command line arguments
   */


  // Variables declaration - do not modify//GEN-BEGIN:variables
  private org.jdesktop.swingx.JXBusyLabel jXBusyLabel1;
  // End of variables declaration//GEN-END:variables

}
